#include "PestaniaUsuarios.h"

void PestaniaUsuarios::CrearCarpetasDeUsuarios()
{
    ABM_Properties abm(ruteConf);
    abm.LevantarFile();
    this->RutaUsersFolder = abm.GetValueFromKey(PATH);
    mkdir(this->RutaUsersFolder.c_str(),0777);

    this->RutaUsersFolder = abm.GetValueFromKey(PATH);
    std::list<Paquete*>::const_iterator it = this->abmPro.begin();
    std::list<Paquete*>::const_iterator itEnd = this->abmPro.end();

    while( it != itEnd )
    {
        std::string RutaTotal;
        Paquete* P = *it ;
        std::string user = P->Key;
        RutaTotal = this->RutaUsersFolder + user;
        std::cout << RutaTotal << std::endl;
        int ret = mkdir( RutaTotal.c_str(),0777 );
        if ( ret == 0 )
        {
            std::string rutaMet = RutaTotal + USRFILES;
            std::ofstream met(rutaMet.c_str());
            met.close();
        }

        it++;
    }

}
